<template>
  <div>
    <el-dialog title="详情" :close-on-click-modal="false" :visible.sync="visible" center>
      <el-button class="miui-dialog-close-btn" @click="visible = false">关闭页面</el-button>
      <el-form :model="dataForm" ref="dataForm" label-width="120px">
        <el-form-item label="ID">
          <span>{{dataForm.code}}</span>
        </el-form-item>
        <el-form-item label="名称">
          <span>{{dataForm.name}}</span>
        </el-form-item>
        <el-form-item label="创建人ID">
          <span>{{dataForm.createUser}}</span>
        </el-form-item>
        <el-form-item label="创建人登录名">
          <span>{{dataForm.createUserName}}</span>
        </el-form-item>
        <el-form-item label="创建时间">
          <span>{{dataForm.createTime}}</span>
        </el-form-item>
        <el-form-item label="最后修改时间">
          <span>{{dataForm.updateTime}}</span>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="visible = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
    import { mapGetters } from 'vuex'
    import { getAddFeeObj, addAddFeeObj, putAddFeeObj } from '@/api/eims/add-fee'


    export default {
    data () {
      return {
        visible: false,
        dataForm: {
          id: 0,
          name: '',
          code: '',
          fee: '',
        }
      }
    },
    computed: {
      ...mapGetters(['bizData'])
    },
    methods: {
      init (id) {
        console.log(id)
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            getAddFeeObj(this.dataForm.id).then(response => {
              this.dataForm = response.data.data
            })
          }
        })
      }
    }
  }
</script>
